<Ui xmlns="http://www.blizzard.com/wow/ui/">

  <!-- Template for category list items -->
  <Frame name="AOSSListButtonTemplate" inherits="OptionsListButtonTemplate" virtual="true">
    <Size x="225" y="18"/>
    <Scripts>
      <OnDoubleClick>
        if self.toggle:IsVisible() then
          self.toggle:Click()
        end
      </OnDoubleClick>
      <OnMouseWheel>
        ScrollFrameTemplate_OnMouseWheel(_G[self:GetParent():GetName().."List"], delta)
      </OnMouseWheel>
    </Scripts>
  </Frame>

  <!-- Template for sample panels -->
  <Frame name="AOSSPanelTemplate" parent="AOSSFramePanelContainer" hidden="true" virtual="true"/>

  <!-- Template for category header panels -->
  <Frame name="AOSSHeaderPanelTemplate" inherits="AOSSPanelTemplate" virtual="true">
    <Layers>
      <Layer level="ARTWORK">
        <FontString name="$parentText" inherits="GameFontHighlight" justifyH="CENTER" justifyV="MIDDLE">
          <Anchors>
            <Anchor point="TOPLEFT">
              <Offset x="10" y="-10"/>
            </Anchor>
            <Anchor point="BOTTOMRIGHT">
              <Offset x="-10" y="10"/>
            </Anchor>
          </Anchors>
        </FontString>
      </Layer>
    </Layers>
  </Frame>

  <!-- Main GUI -->
  <Frame name="AOSSFrame" parent="UIParent" hidden="false" enableMouse="true" movable="true" frameStrata="HIGH">
    <Size x="698" y="520"/>
    <Anchors>
      <Anchor point="CENTER"/>
    </Anchors>
    <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
      <BackgroundInsets>
        <AbsInset left="11" right="11" top="12" bottom="10"/>
      </BackgroundInsets>
      <TileSize val="32"/>
      <EdgeSize val="32"/>
    </Backdrop>
    <Layers>
      <Layer level="ARTWORK">
        <Texture name="$parentHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
          <Size x="350" y="68"/>
          <Anchors>
            <Anchor point="TOP">
              <Offset x="0" y="12"/>
            </Anchor>
          </Anchors>
        </Texture>
        <FontString name="$parentHeaderText" inherits="GameFontNormal">
          <Anchors>
            <Anchor point="TOP" relativeTo="$parentHeader">
              <Offset x="0" y="-14"/>
            </Anchor>
          </Anchors>
        </FontString>
      </Layer>
    </Layers>
    <Frames>
      <Button name="$parentClose" inherits="UIPanelButtonTemplate" text="CLOSE">
        <Size x="96" y="22"/>
        <Anchors>
          <Anchor point="BOTTOMRIGHT">
            <Offset x="-16" y="16"/>
          </Anchor>
        </Anchors>
        <Scripts>
          <OnClick>
            self:GetParent():Hide()
          </OnClick>
        </Scripts>
      </Button>
      <Button name="$parentReload" inherits="UIPanelButtonTemplate" text="Reload">
        <Size x="96" y="22"/>
        <Anchors>
          <Anchor point="BOTTOMRIGHT">
            <Offset x="-116" y="16"/>
          </Anchor>
        </Anchors>
        <Scripts>
          <OnClick>
            ReloadUI()
          </OnClick>
        </Scripts>
      </Button>
      <Frame name="$parentCategories" inherits="OptionsFrameListTemplate">
        <Size x="225" y="429"/>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset x="22" y="-40"/>
          </Anchor>
        </Anchors>
        <Scripts>
          <OnLoad>
            OptionsList_OnLoad(self, "AOSSListButtonTemplate")
            self.update = OptionsCategoryFrame_Update
            self.toggleSubCategories = OptionsFrame_ToggleSubCategories
          </OnLoad>
        </Scripts>
      </Frame>
      <Frame name="$parentDetails">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentCategories" relativePoint="TOPRIGHT">
            <Offset x="16" y="0"/>
          </Anchor>
          <Anchor point="BOTTOMLEFT" relativeTo="$parentCategories" relativePoint="BOTTOMRIGHT">
            <Offset x="16" y="1"/>
          </Anchor>
          <Anchor point="RIGHT">
            <Offset x="-22" y="0"/>
          </Anchor>
        </Anchors>
        <Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
          <EdgeSize val="16"/>
          <TileSize val="16"/>
          <BackgroundInsets left="5" right="5" top="5" bottom="5"/>
        </Backdrop>
        <Frames>
          <ScrollFrame name="MyScrollFrame" inherits="UIPanelScrollFrameTemplate">
            <Anchors>
              <Anchor point="TOPLEFT">
                <Offset x="6" y="-4"/>
              </Anchor>
              <Anchor point="BOTTOMRIGHT">
                <Offset x="-26" y="4"/>
              </Anchor>
            </Anchors>
            <ScrollChild>
              <Frame name="$parentScrollChildFrame">
                <Size>
                  <AbsDimension x="100" y="400"/>
                </Size>
                <Anchors>
                  <Anchor point="TOPLEFT" />
                </Anchors>
                <Frames>
                  <Frame name="AOSSFramePanelContainer">
                    <Size>
                      <AbsDimension x="380" y="400"/>
                    </Size>
                    <Anchors>
                      <Anchor point="TOPLEFT" />
                    </Anchors>
                  </Frame>
                </Frames>
              </Frame>
            </ScrollChild>
          </ScrollFrame>
        </Frames>
        <Scripts>
          <OnLoad>
            self:SetBackdropBorderColor(.6, .6, .6, 1)
          </OnLoad>
        </Scripts>
      </Frame>
    </Frames>
    <Scripts>
      <OnLoad>
        AOSS_OnLoad(self)
      </OnLoad>
      <OnShow>
        OptionsFrame_OnShow(self)
      </OnShow>
      <OnHide>
        OptionsFrame_OnHide(self)
      </OnHide>
      <OnDragStart>
        self:StartMoving()
      </OnDragStart>
      <OnDragStop>
        self:StopMovingOrSizing()
      </OnDragStop>
    </Scripts>
  </Frame>

</Ui>